<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta charset="UTF-8">
		<title>学生信息</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta name="description" content="Creative - Bootstrap 3 Responsive Admin Template">
	    <meta name="author" content="GeeksLabs">
	    <meta name="keyword" content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">
	    <link rel="shortcut icon" href="img/favicon.png">
	    <title>Creative - Bootstrap Admin Template</title>
  </head>
  
  <body>
   		<c:import url="admin_home.jsp"></c:import>
   		<div class="layui-body container" style="margin-top: 100px">
     		<div class="layui-row">
     			<form class="layui-form" action="${pageContext.request.contextPath}/admin/stuInfo.do" method="post">
     				<div class="layui-form-item">
					   <div class="layui-input-inline layui-col-md-offset2 layui-col-md4">
					     <input type="text" id="stuName" name="stuName" lay-verify="required" placeholder="输入学生姓名" autocomplete="off" class="layui-input">
					   </div>
					   <div class="layui-col-md4">
					   	<button class="btn btn-primary" type="submit">查询</button>  
					   </div>
					    
					</div>
				</form>
     		</div>
     		
     		<!-- 显示表格数据 -->
     		<div class="layui-row" >
     			<div class="layui-col-md-offset1 layui-col-md10">
     				<table class="table table-hover">
     					<tr>
     						<th>ID</th>
     						<th>学号</th>
     						<th>姓名</th>
     						<th>性别</th>
     						<th>班级</th>
     						<th>所在团队</th>
     						<th>联系方式</th>
     						<th>操作</th>
     					</tr>
     					<c:forEach items="${page.list}" var="stu">
     						<tr>
     							<th><font size="3px" color="#3B3B3B">${stu.id } </font></th>
     							<th><font size="3px" color="#3B3B3B">${stu.stuId }</font> </th>
     							<th><font size="3px" color="#3B3B3B">${stu.stuName }</font> </th>
     							<th><font size="3px" color="#3B3B3B">${stu.stuSex }</font> </th>
     							<th><font size="3px" color="#3B3B3B">${stu.stuClass }</font>    </th>
     							<th><font size="3px" color="#3B3B3B">${stu.groupName }</font>    </th>
     							<th><font size="3px" color="#3B3B3B">${stu.stuTell }</font>    </th>
     							<th>
	     							
	     							<button class="btn btn-danger btn-sm">
	     								删除
	     							</button>
     							</th>
     						</tr>
     					</c:forEach>
     				</table>
     			</div>
     		</div>
     		<div class="layui-row">
     			<div class="layui-col-md-offset1 layui-col-md3">
     				当前${page.pageNum}页，共${page.pages}页,一共${page.total}条记录
     			</div>
     			<div class="col-md-5">
     				<nav aria-label="Page navigation">
					  <ul class="pagination">
					  	<li><a href="${pageContext.request.contextPath}/admin/stuInfo.do?pn=${1}">首页</a></li>
					  	<c:if test="${page.hasPreviousPage}">
					  		<li>
						      <a href="${pageContext.request.contextPath}/admin/stuInfo.do?pn=${page.pageNum-1}" aria-label="Previous">
						        <span aria-hidden="true">上一页</span>
						      </a>
						    </li>
					  	</c:if>
					    <c:forEach items="${page.navigatepageNums}" var="pn">
					    	<c:if test="${pn==page.pageNum }">
					    		<li class="active"><a href="#">${pn}</a></li>
					    	</c:if>
					    	<c:if test="${pn!=page.pageNum }">
					    		<li ><a href="${pageContext.request.contextPath}/admin/stuInfo.do?pn=${pn}">${pn}</a></li>
					    	</c:if>
					    </c:forEach>
					    <c:if test="${page.hasNextPage}">
					    	<li>
						      <a href="${pageContext.request.contextPath}/admin/stuInfo.do?pn=${page.pageNum+1}" aria-label="Next">
						        <span aria-hidden="true">下一页</span>
						      </a>
						    </li>
					    </c:if>
					    
					    <li><a href="${pageContext.request.contextPath}/admin/stuInfo.do?pn=${page.pages}">尾页</a></li>
					  </ul>
					</nav>
     			</div>
     			
     		</div>
     	
     	</div>
      	<!-- main content end -->
		<script type="text/javascript">
	  </script>
  </body>
</html>
